FileSystemPackageStore.AddPackage Method

Adds a package to PackageStore. The process of adding a package copies the package into a unique directory the PackageStore base path. Any changes to the original file after the package is added are not reflected in the store.

Parent Type: FileSystemPackageStore

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public AddPackageResult AddPackage (
PackageReader packageReader,
PackageEnforcement packageEnforcement

)

Parameters

packageReader

The package to add to the store.

packageEnforcement

The settings to determine whether the package should be modified to allow it to be added to the store.

Return Value

The results of adding the package, including a log of any warnings or errors that occurred in the process.

Exceptions
Exception type Condition
PackageImportException

Thrown if the package could not be added to the store. The exception may include a log indicating a cause for the failure.

ArgumentNullException

Thrown if packageReader or packageEnforcement is not provided.